package com.zxc.controller.util;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class ResponseUtil {

    public static void alert(HttpServletResponse response, String info, String redirtString) throws IOException {
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html; charset=utf-8");
        PrintWriter out = response.getWriter();
        out.write("<script>alert('" + info + "'); window.location.href='" + redirtString + "'</script>");

        out.flush();
        out.close();
    }
}
